home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-10-04 | 4.6 KB | 140 lines |
-
- package sub_arctic.lib;
-
- import sub_arctic.output.drawable;
- import sub_arctic.output.loaded_image;
-
- import java.awt.Graphics;
-
- /**
- * This is a column (a tiled layout of its children from top to bottom)
- * with a background behind the children.
- *
- * @author Scott Hudson
- */
- public class backdrop_column extends column {
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Background pattern for this column
- */
- protected loaded_image _pattern = null;
-
- /**
- * Background pattern
- * @return loaded_image the pattern currently in use.
- */
- public loaded_image pattern() {return _pattern;}
-
- /**
- * Set the Background pattern
- * @param loaded_image pat the new pattern to use for this column (you
- * can pass null if you don't want a pattern right
- * now).
- */
- public void set_pattern(loaded_image pat)
- {
- /* set pattern and cause redraw */
- if (_pattern != pat)
- {
- _pattern = pat;
- damage_self();
- }
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Full constructor for a backdrop column. We assume you want us to do
- * sizing automatically with constraints.
- *
- * @param int xv x position of the column.
- * @param int yv y position of the column.
- * @param int brd the border around the children of the column (in
- * pixels).
- * @param int ic inter-child spacing (in pixels).
- * @param boolean box whether or not to put a box around this interactor.
- * @param byte lt the type of layout to use for this column (must be
- * one of LEFT_JUSTIFIED, RIGHT_JUSTIFIED, OR
- * CENTER_JUSTIFIED).
- * @param loaded_image pat the pattern to use for the background (you can
- * pass null if you don't want a pattern right now).
- */
- public backdrop_column(
- int xv, int yv,
- int brd, int ic, boolean box,
- byte lt,
- loaded_image pat)
- {
- /* we assume you don't want this be opaque because you are
- presumably supplying a backdrop! */
- super(brd,ic,box,false,lt);
- set_pattern(pat);
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Smaller constructor for a backdrop column. This assumes you will
- * do the positioning of the object with constraints. Again, we will
- * do the sizing via constraints.
- *
- * @param int brd the border around the children of the column (in
- * pixels).
- * @param int ic inter-child spacing (in pixels).
- * @param boolean boxed whether or not to put a box around this
- * interactor.
- * @param byte lt the type of layout to use for this column (must
- * be one of LEFT_JUSTIFIED, RIGHT_JUSTIFIED, OR
- * CENTER_JUSTIFIED).
- * @param loaded_image pat the pattern to use for the background (you can
- * pass null if you don't want a pattern right now).
- */
- public backdrop_column(
- int brd, int ic, boolean box,
- byte lt,
- loaded_image pat)
- {
- /* we assume you don't want this be opaque because you are
- presumably supplying a backdrop! */
- super(brd,ic,box,false,lt);
- set_pattern(pat);
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Draw the object on the supplied drawable.
- * @param drawable d the drawable to do the drawing on.
- */
- protected void draw_self_local(drawable d)
- {
- /* draw the backdrop then let the super class do the rest */
- if (pattern() != null)
- d.tileImage(pattern(), 0,0, w()-1, h()-1);
-
- super.draw_self_local(d);
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- }
-
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-